Skip to content

chore: bump cUR and k_quirc - #138

Merged
odudex merged 2 commits into
masterfrom
chore--bump-cUR-and-k_quirc
Aug 14, 2026
Merged

chore: bump cUR and k_quirc#138
odudex merged 2 commits into
masterfrom
chore--bump-cUR-and-k_quirc

Conversation

@odudex

@odudex odudex commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Several memory and logic fixes in both submodules

odudex added 2 commits August 14, 2026 17:26
cUR and k_quirc now mark their failure-signalling functions warn_unused_result and build with -Werror=unused-result. Kern's call sites into both already checked every return, so adopting the same attribute on Kern's own API was free to try: KERN_WARN_UNUSED_RESULT in main/utils/attributes.h, applied to 165 declarations across core/, qr/ and utils/. It found 42 discarded results.

The one that mattered: pin_is_configured() returns false when the module is not initialized, and session_lock_boot_gate() routes that straight to unlock_finished(). pin_init()'s result was dropped in both app_main() and the simulator, so a failed init booted a device that has a PIN set straight past its own PIN gate. Both now fail closed.

pin_wipe_all() discarded settings_reset_all(), storage_init() and storage_wipe_flash(), then called esp_restart() regardless, making a failed anti-brute-force wipe indistinguishable from a clean one. Each step now logs and the flash wipe retries once. Its esp_err_t return was fiction since the function never returns, so it is void now. storage_sanitize_id() formatted an uninitialised hash buffer when crypto_sha256() failed, putting stack bytes into a name shown in the UI and used to build a filename.

Also handled: pin_remove() at three sites and pin_set_max_failures() reported success the storage had not accepted, registry_remove() and registry_set_label() desynced the UI from the registry, registry_add_from_string() silently dropped autoloaded descriptors, and settings.c now logs every failed write once with the key that could not be stored. Where the caller genuinely cannot act the attribute is left off rather than worked around at the call site, documented in settings.h and encoder.h: settings_set_* persist a preference already applied in session, and qr_create_optimal() returns a parent-owned widget that leaks nothing when discarded.
@odudex
odudex force-pushed the chore--bump-cUR-and-k_quirc branch from e2cd6d0 to d00a337 Compare August 14, 2026 21:04
@odudex
odudex merged commit ea66257 into master Aug 14, 2026
12 checks passed
@odudex
odudex deleted the chore--bump-cUR-and-k_quirc branch August 27, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant